<extend name="Layout/ins_page" />
<block name="content">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>
	<style>
	.connent {list-style-type:none}
.connent li{border-bottom: 1px solid gray}
	</style>
    
</head>
<body >



  
   
    <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;margin-top: 5px;overflow:auto;" plain="false"
    buttons="#tabsButtons"
>
    <div title="订单信息" >
   
    <div id="datagrid1" class="mini-datagrid" style="height:100px;width: 100%;" 
        url="" idField="id"
        allowResize="true" 
        allowCellEdit="true" allowCellSelect="true" multiSelect="true"
        allowCellValid="true" oncellvalidation="onCellValidation" showPager='false'>
        <div property="columns">
            
            <div field="orderid" vtype=""   headerAlign="center"  >订单号
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>  
            
             <div field="goodsspu" vtype=""   headerAlign="center"  >物料编号
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div> 
            
              <div field="goodsname" vtype=""   headerAlign="center"  >物料名称
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>    
            
             <div field="customer"    headerAlign="center"  >客户姓名
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>    
            
             <div field="tel"    headerAlign="center"  >客户电话
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>           
            
            <div field="address"    headerAlign="center"  >客户地址
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>   
            
            
              <div field="expcom"    headerAlign="center"  >快递公司
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div> 
            
             <div field="expno"    headerAlign="center"  >快递单号
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div> 
            
             <div field="senduser"    headerAlign="center"  >工单对接人
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div> 
            
            
      
        </div>
    </div>
    
    
    </div>
  
</div>
<input value="{$wk.wk_no}" id='wkk_no' type="hidden">
  <div id='editForm1'>
     流转原因：{$remarks}
  </div>
  <br/>
   <div id='editForm1'>
   <?php if($isaccess){ ?>
     回复内容：
 	<textarea  class="editor" id="remarks" name="remarks" class="col-xs-12"></textarea>
    <br/>
    <a class="mini-button" onclick="save" enabled="" id='update-bt' style="">&nbsp;&nbsp;提交回复&nbsp;&nbsp;</a>
    
     <?php if($issaveend){ ?>
     <a class="mini-button" onclick="saveend" enabled="" id='update-bt' style="">&nbsp;&nbsp;完结&nbsp;&nbsp;</a>
     <?php }?>
  </div>
  <?php }?>
  <br/>
  <a href="javascript:jQuery('#show-connent').toggle()"> 查看回复记录</a>
  <div style="" id="show-connent">
  
  <?php foreach($wkinfo as $info){ ?>
	<ul class='connent' >
	  <li>
			<?php echo $info['user']?> 在 <?php echo $info['ctime']?> 回复:<br/><br/>
			<?php echo $info['connent']?>
			
	 <li>
 </ul>
	

<?php };?>
  
  </div>
  
</body>
<script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        var data = <?php echo $data ?>;
        grid.setData(data);
        
        
        function saveend(){
            mini.mask({
                el: document.body,
                cls: 'mini-mask-loading',
                html: '提交中...'
            });
            var wk_no =jQuery("#wkk_no").val();
            $.ajax({
                url: "/wkorder/saveend",
                data: { wk_no:wk_no},
                type: "post",
                dataType:'json',
                success: function (text) {
                   if(text.res>0){
                	    mini.unmask(document.body);
						mini.alert('操作成功');
						window.history.back(-1); 
                   }
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    alert(jqXHR.responseText);
                }
            });
        }
        
        function save() {
           
            
            var wk_no =jQuery("#wkk_no").val();
            if(wk_no==''){
            	 mini.alert('工单错误');
            	 return ;
            }
            var remarks = tinyMCE.activeEditor.getContent() ;
            if(remarks==''){
           	 mini.alert('请输入回复内容');
           	 return ;
           }
            
             if(remarks==''){
            	 mini.alert('请填写流转原因');
            	 return ;
             }

            mini.mask({
                el: document.body,
                cls: 'mini-mask-loading',
                html: '回复中...'
            });
            $.ajax({
                url: "/wkorder/saveaccess",
                data: { wk_no:wk_no,remarks:remarks},
                type: "post",
                dataType:'json',
                success: function (text) {
                   if(text.res>0){
                	    mini.unmask(document.body);
                	    tinyMCE.activeEditor.setContent(' ') ;
						mini.alert('回复成功!');
						window.history.back(-1); 
						
                   }
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    alert(jqXHR.responseText);
                }
            });
        }
        
        window.onbeforeunload=function(e){     
            var e=window.event||e;  
           alert(11)
        }  
    </script>
</html>
</block>
